<%@ page import="weaver.general.*" %>
<%@ page import="weaver.conn.*" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    bb.writeLog("in--test20200727");
    RecordSetDataSource rsd = new RecordSetDataSource("old_oa");
    RecordSetDataSource rsd1 = new RecordSetDataSource("old_oa");
    rsd.execute("select concat('field',fieldid) as fieldid from cus_formfield where scope='DocCustomFieldBySecCategory'");
    bb.writeLog("select concat('field',fieldid) as fieldid from cus_formfield where scope='DocCustomFieldBySecCategory'");
    int sum1 = 0;
    int sum2 = 0;
    while (rsd.next()) {
        String fieldid = Util.null2String(rsd.getString("fieldid"));
        rsd1.execute("select id," + fieldid + " as tmp from cus_fielddata where scope='DocCustomFieldBySecCategory' and " + fieldid + " in ('0','1')");
        bb.writeLog("select id," + fieldid + " as tmp from cus_fielddata where scope='DocCustomFieldBySecCategory' and " + fieldid + " in ('0','1')");
        int count1 = 0;
        int count2 = 0;
        while (rsd1.next()) {
            String id = Util.null2String(rsd1.getString("id"));
            String tmp = Util.null2String(rsd1.getString("tmp"));
            if ("0".equals(tmp)) {
                count1++;
                bb.writeLog("----docid="+id+"");

            } else if ("1".equals(tmp)) {
                count2++;
                bb.writeLog("----docid="+id+"");
            }
        }
        bb.writeLog("------fieldid=" + fieldid + "---count1=" + count1 + "---count2=" + count2);
        sum1 +=count1;
        sum2 +=count2;
    }
    bb.writeLog("---老系统中为机密的文档有[" + sum1 + "],为秘密的文档有[" + sum2+"]");
    out.print("---老系统中为机密的文档有[" + sum1 + "],为秘密的文档有[" + sum2+"]");
%>